package com.elinkway.infinitemovies.bean;

import com.lvideo.http.bean.LVideoBaseBean;

import java.util.ArrayList;
import java.util.List;

public class PlayData implements LVideoBaseBean{
	
	/**
	 * zhangshuo
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 播放记录，包含播放进度
	 */
	private PlayRecord mPlayRecord;
	
	/**
	 * 影片名称
	 */
	private String mViewName;
	private String aid;
	private String porder;
	private ArrayList<Episode> episodes = new ArrayList<Episode>();
	private String site;
	private String poster;

	public String getFsAid() {
		return fsAid;
	}

	public void setFsAid(String fsAid) {
		this.fsAid = fsAid;
	}

	private String fsAid;
	
	/**
	 * 跳转来源页面
	 */
	private String from;
	
	/**
	 * 当前类型
	 */
	private String vt;
	
	/**
	 * 是否是本地下载播放
	 */
	private boolean isLocalVideo;
	/**
	 * 播放源
	 */
	private String sitNmae;
	
	private String src;
	
	private ArrayList<String> mPorderLists;
	
    private ArrayList<String> liveStreams;

    private ArrayList<LocalVideoEpisode> mLocalDataLists;

	// 直播 liveid
	private String mLiveId;

	//category  视频类型，1-电影，2-电视剧，5-动漫。。。
	private String category;

	private String categoryName;

	private String subcategoryname;

	private String areaname;

	private String year;

	private String themeId;		//专题id，主要是专题tab下

	private String externalId; //第三方播放使用的aid(搜狐等)

	private String player;//控制吊起播放器

	public String getScript() {
		return script;
	}

	public void setScript(String script) {
		this.script = script;
	}

	private String script;

	public String getPlayer() {
		return player;
	}

	public void setPlayer(String player) {
		this.player = player;
	}

	public String getExternalId() {
		return externalId;
	}

	public void setExternalId(String externalId) {
		this.externalId = externalId;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public String getCategoryName() {
		return this.categoryName;
	}

	public String getmLiveId() {
		return mLiveId;
	}

	public void setmLiveId(String mLiveId) {
		this.mLiveId = mLiveId;
	}

	public ArrayList<LocalVideoEpisode> getmLocalDataLists() {
		return mLocalDataLists;
	}

	public void setmLocalDataLists(ArrayList<LocalVideoEpisode> mLocalDataLists) {
		this.mLocalDataLists = mLocalDataLists;
	}

	private VideoDataBean videoBean;

	public VideoDataBean getVideoBean() {
		return videoBean;
	}

	public void setVideoBean(VideoDataBean videoBean) {
		this.videoBean = videoBean;
	}

	public PlayData() {
		
	}

	public PlayData(SubscriptionAlbum subscriptionAlbum, String porder){
		super();
		this.setAid(subscriptionAlbum.getAid());
		this.setVt(subscriptionAlbum.getSrc());
		this.setPorder(porder);
		this.mViewName = subscriptionAlbum.getName();
		this.setSite(subscriptionAlbum.getSub_src());
		this.mPorderLists = new ArrayList<String>();

		List<SubscriptionVideo> subVideoList = subscriptionAlbum.getVideoList();
		if(subVideoList != null && subVideoList.size() > 0){
			Episode item = null;
			SubscriptionVideo subVideo = null;
			for (int i=0; i<subVideoList.size(); i++){
				subVideo = subVideoList.get(i);
				if(subVideo != null){
					item = new Episode();
					item.setName(subVideo.getName());
					item.setPlay_url(subVideo.getUrl());
					item.setPorder(subVideo.getPorder());
					mPorderLists.add(subVideo.getPorder());
				}
				episodes.add(item);
				item = null;
			}
		}
	}

	/**
	 * 播放历史跳转生成
	 * @param mPlayRecord
	 * @param episodes
	 * @param from
	 */
	public PlayData(PlayRecord mPlayRecord,
	        ArrayList<Episode> episodes, String from) {
		super();
		this.mPlayRecord = mPlayRecord;
		this.porder = mPlayRecord.getPorder();
		this.site = mPlayRecord.getSite();
		this.mViewName = mPlayRecord.getName();
		this.aid = mPlayRecord.getAid();
		this.poster = mPlayRecord.getPoster();
		this.episodes = episodes;
		this.from = from;
		this.vt = mPlayRecord.getVt();
		this.categoryName = mPlayRecord.getCategoryName();
	}
	
	/**
	 * 详情页跳转生成
	 * @param video
	 * @param porder
	 * @param playRecord
	 * @param from
	 */
	public PlayData(VideoDataBean video,String porder,PlayRecord playRecord, String from) {
		super();
		this.setVideoBean(video);
		this.setAid(video.getAid());
		this.setExternalId(video.getExternalId());
		this.setFsAid(video.getPlaySrcBean().getExternalId());
		this.setPlayer(video.getPlaySrcBean().getPlayer());
		this.setScript(video.getPlaySrcBean().getScript());
		this.mViewName=video.getName();
		this.episodes = video.getEpisodeList();
		this.porder = porder;
		this.setSite(video.getSubsrc());
		this.mPlayRecord = playRecord;
		this.from=from;
		this.vt = video.getVt();
		this.sitNmae = video.getSitename();
		this.setCategoryName(video.getCategoryname());
		this.setCategory(video.getCategory());
		this.setThemeId(video.getThemeId());
		this.setSubcategoryname(video.getSubcategoryname());
		this.setAreaname(video.getAreaname());
		this.setYear(video.getYear());
		this.poster = video.getPoster();
	}
	
	public PlayData(VideoDataBean video,String porder, String from) {
		this(video,porder,null,from);
	}


	public String getmViewName() {
		return mViewName;
	}

	public void setmViewName(String mViewName) {
		this.mViewName = mViewName;
	}

	public String getPorder() {
		return porder;
	}

	public void setPorder(String porder) {
		this.porder = porder;
	}

	public ArrayList<Episode> getEpisodes() {
		return episodes;
	}

	public void setEpisodes(ArrayList<Episode> episodes) {
		this.episodes = episodes;
	}
	public String getAid() {
		return aid;
	}
	public void setAid(String aid) {
		this.aid = aid;
	}
	public String getSite() {
		return site;
	}
	public void setSite(String site) {
		this.site = site;
	}
	public PlayRecord getmPlayRecord() {
		return mPlayRecord;
	}
	public void setmPlayRecord(PlayRecord mPlayRecord) {
		this.mPlayRecord = mPlayRecord;
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	
	public String getVt() {
		return vt;
	}

	public void setVt(String vt) {
		this.vt = vt;
	}
	public Boolean getIsLocalVideo() {
		return isLocalVideo;
	}

	public void setIsLocalVideo(Boolean isLocalVideo) {
		this.isLocalVideo = isLocalVideo;
	}
	
	public String getSitNmae() {
		return sitNmae;
	}

	public void setSitNmae(String sitNmae) {
		this.sitNmae = sitNmae;
	}
	
	public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }
    
    public ArrayList<String> getLiveStreams() {
        return liveStreams;
    }

    public void setLiveStreams(ArrayList<String> liveStreams) {
        this.liveStreams = liveStreams;
    }
    
    public ArrayList<String> getmPorderLists() {
        return mPorderLists;
    }

    public void setmPorderLists(ArrayList<String> mPorderLists) {
        this.mPorderLists = mPorderLists;
    }

	public String getThemeId() {
		return themeId;
	}

	public void setThemeId(String themeId) {
		this.themeId = themeId;
	}

	public String getPoster() {
		return poster;
	}

	public void setPoster(String poster) {
		this.poster = poster;
	}

	public String getSubcategoryname() {
		return subcategoryname;
	}

	public void setSubcategoryname(String subcategoryname) {
		this.subcategoryname = subcategoryname;
	}

	public String getAreaname() {
		return areaname;
	}

	public void setAreaname(String areaname) {
		this.areaname = areaname;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}
}
